import http from '../utils/request.js'

// 获取用户信息
// query   userId 用户id
export const getuserinfo = (params) => {
	return http.get('/app/user/findUserById', {params})
}

// 更改密码
// query  newPassword 新密码 userId 用户id
export const changepassword = (params) => {
	return http.put(`/app/user/updatePassword?newPassword=${params.newPassword}&userId=${params.userId}`)
}

// 更新用户信息 
// body   userId 用户Id 用户消息
export const updateuser = (params) => {
	return http.put('/app/user/updateUser', params)
}

// 微信授权
export const getwechatUrl = () => {
	return http.get('/app/user/wechatlogin')
}

// 获取用户的信息
// code
export const getwechatinfo = (params) => {
	return http.put(`/app/user/getUserInfo?code=${params}`)
}

// 检验token
// query  access_token 	获取的token openid 用户的openid
export const istoken = (params) => {
	return http.get('/app/user/istoken')
}